package fr.cephb.operonj.core.db.binding;

import com.sleepycat.bind.tuple.TupleBinding;
import com.sleepycat.bind.tuple.TupleInput;
import com.sleepycat.bind.tuple.TupleOutput;

import fr.cephb.operonj.core.bio.Build;

/**
 * BuildBinding
 *
 */
public class BuildBinding extends TupleBinding<Build>
	{
	@Override
	public Build entryToObject(TupleInput input)
		{
		return new Build(
				input.readInt(),
				input.readString(),
				input.readString(),
				input.readInt(),  
				input.readString()
				);
		}
	
	@Override
	public void objectToEntry(Build b, TupleOutput output)
		{
		output.writeInt(b.getId());
		output.writeString(b.getLabel());
		output.writeString(b.getDescription());
		output.writeInt(b.getTaxId());
		output.writeString(b.getTaxName());
		};
	}
